/**
 * 
 */
package wangjg.game.android;

import android.graphics.Bitmap;
import wangjg.game.layer.Image;
import wangjg.xuexiban.util.ResoureCache;

/**
 * @author wangjg
 *
 */
public class AnImage implements Image {
	protected ResoureCache rc = new ResoureCache();
	private Bitmap bitmap;
	
	public AnImage(String filePath) {
		bitmap = rc.get(filePath);
	}
	
	public AnImage(Bitmap bitmap) {
		this.bitmap = bitmap;
	}

	@Override
	public int getHeight() {
		if(this.bitmap==null){
			return 0;
		}
		return this.bitmap.getHeight();
	}

	@Override
	public int getWidth() {
		if(this.bitmap==null){
			return 0;
		}
		return this.bitmap.getHeight();
	}

	@Override
	public Object getBitmap() {
		return bitmap;
	}

}
